package synchronization.producerconsumer;

import java.util.Random;

public class Producer implements Runnable {
	
	private static final String IMP_INFO[] = {
            "This is Message1",
            "This is Message2",
            "This is Message3",
            "This is Message4"
    };
	
    private Drop drop;

    public Producer(Drop drop) {
        this.drop = drop;
    }

    public void run() {
        Random random = new Random();

        for (String info : IMP_INFO) {
            drop.put(info);
            try {
                Thread.sleep(random.nextInt(5000));
            } catch (InterruptedException e) {}
        }
        
        drop.put("DONE");
    }
}
